package com.foreveross.fetl.core.domain.freight;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.dayatang.domain.InstanceFactory;
import com.foreveross.fetl.common.domain.BaseEntity;
import com.foreveross.fetl.core.domain.freight.repository.IAirChinaTaobaoRepository;

@Entity
@Table(name="airChina_taobao")
public class AirChinaTaobaoEntity extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = -1322649989031126524L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	/**
	 * 抓取rowkey
	 */
	@Column(name="HBASE_KEY")
	private String hbaseKey;
	
	/**
	 * 航班所属航空公司简称 CA
	 */
	@Column(name="CARRIER_KEY")
	private String carrierKey;
	
	/**
	 * 报表日期  2014-01-01
	 */
	@Column(name="REPORT_DATE")
	private Date reportDate;
	
	/**
	 * 航班日期 2014-01-01
	 */
	@Column(name="FLIGHT_DATE")
	private Date flightDate;
	
	/**
	 * 创建时间
	 */
	@Column(name="CREATE_TIME")
	private Date createTime;
	
	/**
	 * 出发城市三字码
	 */
	@Column(name="FROM_CITY_CODE")
	private String fromCityCode;
	
	/**
	 * 出发城市名称
	 */
	@Column(name="FROM_CITY_NAME")
	private String fromCityName;
	
	/**
	 * 到达城市三字码
	 */
	@Column(name="TO_CITY_CODE")
	private String toCityCode;
	
	
	/**
	 * 到达城市名称
	 */
	@Column(name="TO_CITY_NAME")
	private String toCityName;
	
	/**
	 * 航班号
	 */
	@Column(name="FLIGHT_NO")
	private String flightNo;
	
	/**
	 * 旗舰价
	 */
	@Column(name="ULTIMATE_PRICE")
	private Double ultimatePrice;
	
	
	/**
	 * 代理价格
	 */
	@Column(name="AGENT_PRICE")
	private Double agentPrice;
	
	/**
	 * 价差金额  旗舰价-代理价
	 */
	@Column(name="SPREAD_AMOUNT")
	private Double spreadAmount;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getHbaseKey() {
		return hbaseKey;
	}

	public void setHbaseKey(String hbaseKey) {
		this.hbaseKey = hbaseKey;
	}

	public String getCarrierKey() {
		return carrierKey;
	}

	public void setCarrierKey(String carrierKey) {
		this.carrierKey = carrierKey;
	}

	public Date getReportDate() {
		return reportDate;
	}

	public void setReportDate(Date reportDate) {
		this.reportDate = reportDate;
	}

	public Date getFlightDate() {
		return flightDate;
	}

	public void setFlightDate(Date flightDate) {
		this.flightDate = flightDate;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getFromCityCode() {
		return fromCityCode;
	}

	public void setFromCityCode(String fromCityCode) {
		this.fromCityCode = fromCityCode;
	}

	public String getFromCityName() {
		return fromCityName;
	}

	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}

	public String getToCityCode() {
		return toCityCode;
	}

	public void setToCityCode(String toCityCode) {
		this.toCityCode = toCityCode;
	}

	public String getToCityName() {
		return toCityName;
	}

	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}

	public String getFlightNo() {
		return flightNo;
	}

	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}

	public Double getUltimatePrice() {
		return ultimatePrice;
	}

	public void setUltimatePrice(Double ultimatePrice) {
		this.ultimatePrice = ultimatePrice;
	}

	public Double getAgentPrice() {
		return agentPrice;
	}

	public void setAgentPrice(Double agentPrice) {
		this.agentPrice = agentPrice;
	}

	public Double getSpreadAmount() {
		return spreadAmount;
	}

	public void setSpreadAmount(Double spreadAmount) {
		this.spreadAmount = spreadAmount;
	}
	
	public IAirChinaTaobaoRepository getIAirChinaTaobaoRepository(){
		return InstanceFactory.getInstance(IAirChinaTaobaoRepository.class);
	}
	public int creatReport(List<String> channels, List<String> carrierKeys,String fromCity,
			String toCity, Date startTime,Date endTime, Date flightDate){
		return getIAirChinaTaobaoRepository().creatReport(channels, carrierKeys, fromCity, toCity, startTime, endTime, flightDate);
	}
	

}
